<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8"/>
    <title>文件测试</title>
    <script th:src="@{/js/jquery-2.1.4.min.js}"></script>
</head>
<body>
<form id="upload" enctype="multipart/form-data" method="post" action="/file/uploadFileAction">
    <input type="file" name="uploadFile"/>
    <input type="hidden" name="id" value="12"/>
    <input type="button" value="文件上传" onclick="doUpload()"/>
</form>
    <input type="button" value="下载文件" onclick="doDownload()"/>
<form id="download" method="post" action="/file/downloadFileAction">

</form>
<script type="text/javascript">    function doUpload() {
    var upl = document.getElementById("upload");
    upl.submit();
}

function doDownload() {
    var upl = document.getElementById("download");
    upl.submit();
}</script>
</body>
</html>



